package com.example.xgakj.newterminal.adapter;

import android.content.Context;
import android.widget.TextView;

import com.example.xgakj.newterminal.R;
import com.example.xgakj.newterminal.beans.CustomerBean;


/**
 * Created by Lzx on 2016/12/30.
 */

public class DeviceDataAdapter extends ListBaseAdapter<CustomerBean> {

    public DeviceDataAdapter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_device_list;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        CustomerBean item = mDataList.get(position);
        String statusText;
        TextView cuid = holder.getView(R.id.id);
        TextView name = holder.getView(R.id.name);
        TextView status = holder.getView(R.id.status);
        cuid.setText(item.getCUID());
        name.setText(item.getName());
        //设备状态 0布防 1撤防 2不在线
        switch (item.getStatus()){
            case 0:
                statusText="布防";
                break;
            case 1:
                statusText="撤防";
                break;
            case 2:
                statusText="不在线";
                break;
            default:
                statusText="不在线";

        }
        status.setText(statusText);

    }
}
